package server;


import interfaces.Product;

import java.rmi.RemoteException;
import javax.rmi.PortableRemoteObject;

public class ProductImpl extends PortableRemoteObject implements Product {
	private CategoryImpl category = null;
	private String name = null;
	private double price = 0.00;

	/**
	 * Constructor
	 * @param newCategory	The Product Category
	 * @param newName		The Product name
	 * @param newPrice		The Product price
	 * @throws RemoteException
	 */
	public ProductImpl( CategoryImpl newCategory, String newName, double newPrice ) throws RemoteException {
		super();
		
		category = newCategory;
		name = newName;
		price = newPrice;
	}

	/**
	 * Returns the Category the Product belongs to
	 * 
	 * @return
	 * @throws RemoteException
	 */
	public CategoryImpl getCategory() {
		return category;
	}

	/**
	 * Returns the Product name
	 * 
	 * @return
	 * @throws RemoteException
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * Returns the Product price
	 * 
	 * @return
	 * @throws RemoteException
	 */
	public double getPrice() {
		return price;
	}
}
